import React from 'react'

export default function Index() {
    const ref = React.useRef()
    const showData = () => {
        alert(ref.current.value)
    }
  return (
    <div>
        <input type="text" ref={ref} />
        <button onClick={showData}>点我提示输入框的值</button>
    </div>
  )
}
